package org.csmzxy.class2333;

import java.util.Scanner;

public class ShuiXianHuaSuanFa {
    public static void main(String[] args){
        int baiwei,shiwei,gewei;
        Scanner myScanner = new Scanner(System.in);
        System.out.println("请输入判断是否为水仙花数的数：");
        int count = myScanner.nextInt();
        baiwei = count / 100;
        shiwei = count % 100 / 10;
        gewei = count % 100;
        if (count >=100 && count <=1000){
            if (Math.pow(baiwei, 3) + Math.pow(shiwei, 3) + Math.pow(gewei, 3) == count){
                System.out.println(count + "是水仙花数！");
            }
            else {
                System.out.println(count +"不是水仙花数！");
            }
        }
        else{
            System.out.println(count +"请输入100~1000之间的整数！");
        }
    }
}
